using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using MeetingRoom.Domain;

namespace MeetingRoom.Data.Implementation
{
    public abstract class MeetingRoomTypeDAOSupport
    {
        public static List<MeetingRoom.Domain.MeetingRoomType>
            GetMeetingRoomTypes(IDataReader reader)
        {
            List<MeetingRoom.Domain.MeetingRoomType> list 
                = new List<MeetingRoom.Domain.MeetingRoomType>();

            while (reader.Read())
            {
                MeetingRoomType newMeetingRoomType = new MeetingRoomType();
                newMeetingRoomType.Id = (Int32)reader["meetingroomtype_id"];
                newMeetingRoomType.Size = (Int32)reader["size"];
                newMeetingRoomType.Count = (Int32)reader["total"];
                newMeetingRoomType.Projector = Boolean.Parse((string)reader["projector"]);

                list.Add(newMeetingRoomType);
            }
            return list;
        }
    }
}
